<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit" />
	<meta http-equiv="Cache-Control" content="no-transform" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="apple-nobile-web-app-capable" content="yes" />
	<meta name="wap-font-scale" content="no" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,viewport-fit=cover">
	<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
		<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.cdn.css[i] %>" />
	<% } %>
	<title>
		<%= htmlWebpackPlugin.options.title %>
	</title>
	<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
		<script type="text/javascript" src="<%= htmlWebpackPlugin.options.cdn.js[i] %>"></script>
	<% } %>
</head>
<body>
	<noscript>
		<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled.
				Please enable it to continue.</strong>
	</noscript>
	<script type="text/javascript">
		(function() {
			var ua= navigator.userAgent;
			if(ua.toLowerCase().match(/MicroMessenger/i) == "micromessenger") {
                
				setTimeout(function() {                    
                    var Api = Vue.prototype.$api;
                    var Util = Vue.prototype.$util;
                    var Cache = Vue.prototype.$cache;
					// 初始化微信配置
					function config() {
						// var subject = Util.getSubject(Cache.subject);
                        
						axios.get(Api.wxJsSdk +'?url=' + encodeURIComponent(window.location.href))
						.then(res => {
							if(res.code == 200) {
								wx.config({
									debug: false,
									appId: res.data.wx_app_id,
									timestamp: res.data.timestamp,
									nonceStr: res.data.nonce_str,
									signature: res.data.signature,
									jsApiList: [
										'chooseImage',
										'previewImage',
										'uploadImage',
										'downloadImage',
										'getNetworkType',
										'getLocation',
										'openLocation',
										'hideOptionMenu',
										'showOptionMenu',
										'hideMenuItems',
										'showMenuItems',
										'closeWindow',
										'scanQRCode',
										'onMenuShareTimeline',
										'onMenuShareAppMessage',
										'updateAppMessageShareData',
										'updateTimelineShareData'
									],
									openTagList: [
										'wx-open-launch-weapp'
									]
								})
								wx.error(function(res) {
									console.error('微信配置失败');
								})
								wx.ready(function() {
									wx.hideOptionMenu();
								})
							}
						})
					}
					config();
				},500)
			} else {
				console.warn('--tips：wx.config--', '非微信环境')
			}	
		})();
	</script>
	<div id="app"></div>
	<!-- built files will be auto injected -->

	<!-- 修复微信调整字体大小问题 -->
	<script type="text/javascript">
		(function() {
		  if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
			  handleFontSize();
		  } else {
			  if (document.addEventListener) {
				  document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
			  } else if (document.attachEvent) {
				  document.attachEvent("WeixinJSBridgeReady", handleFontSize);
				  document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
			  }
		  }
		  function handleFontSize() {
			  WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
			  WeixinJSBridge.on('menu:setfont', function() {
				  WeixinJSBridge.invoke('setFontSizeCallback', { 'fontSize' : 0 });
			  });
		  }
		})();
	</script>
</body>
</html>